import request from '@/utils/request'

// 获取员工列表
export function getEmployeeList(data) {
  return request({
    url: '/sys/user',
    params: data
  })
}

// 新增员工
export function fetchAddEmployee(data) {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}

// 删除员工
export function fetchDelEmployee(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}

// 批量-导入员工
/**
 * @description: 导入excel
 * @param {*} data
    [
      {
        mobile: 15751786320
        timeOfEntry: "2019-03-09T16:00:00.000Z"
        username: "测试人员1"
        workNumber: 88088,
        formOfEmployment: 0,
        departmentName: "技术部"
      }
    ]
 * @return {*}
 */
export function fetchUploadExcel(data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
